package sort.util;

/**
 * 排序工具类
 */
public class SortUtil {
    /**
     * 交换两个元素值
     * @param c
     * @param i
     * @param j
     */
    public static void swap(Comparable[] c, int i, int j) {
        Comparable temp = c[i];
        c[i] = c[j];
        c[j] = temp;
    }

    /**
     * 比较大小
     * 严格大于
     * @param c1
     * @param c2
     * @return
     */
    public static boolean greater(Comparable c1,Comparable c2) {
        return c1.compareTo(c2) > 0;
    }


    public static void display(Comparable[] nums) {
        for (Comparable num : nums) {
            System.out.print(num+" ");
        }
    }
}
